﻿using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Character;
using UnityEngine;
using UnityEngine.UI;
using UnityStandardAssets.ImageEffects;

// Token: 0x020001C6 RID: 454
public class CutScene : Scene
{
	// Token: 0x17000162 RID: 354
	// (get) Token: 0x06000BB3 RID: 2995 RVA: 0x00044104 File Offset: 0x00042304
	public List<CutAction> Actions
	{
		get
		{
			return this.actions;
		}
	}

	// Token: 0x17000163 RID: 355
	// (get) Token: 0x06000BB4 RID: 2996 RVA: 0x0004410C File Offset: 0x0004230C
	// (set) Token: 0x06000BB5 RID: 2997 RVA: 0x00044114 File Offset: 0x00042314
	public Color FilterColor { get; set; }

	// Token: 0x17000164 RID: 356
	// (get) Token: 0x06000BB6 RID: 2998 RVA: 0x00044120 File Offset: 0x00042320
	// (set) Token: 0x06000BB7 RID: 2999 RVA: 0x00044128 File Offset: 0x00042328
	public bool IsPlay { get; set; }

	// Token: 0x17000165 RID: 357
	// (get) Token: 0x06000BB8 RID: 3000 RVA: 0x00044134 File Offset: 0x00042334
	// (set) Token: 0x06000BB9 RID: 3001 RVA: 0x0004413C File Offset: 0x0004233C
	public float LastVoiceTime { get; set; }

	// Token: 0x06000BBA RID: 3002 RVA: 0x00044148 File Offset: 0x00042348
	private void Awake()
	{
		base.InScene(true);
		base.GC.audioCtrl.BGM_Stop();
		if (this.sceneInMsg.Length > 0)
		{
			string[] array = this.sceneInMsg.Split(new char[]
			{
				','
			});
			if (array.Length == 2)
			{
				this.listAssetBundle = array[0];
				this.listAssetName = array[1];
			}
			else
			{
				GlobalData.Debug_LogError("场景信息不明:" + this.sceneInMsg);
			}
		}
		this.factory = new CutActFactory(this);
		this.factory.Register(CutScene.ActNames[0], new CutAct_JumpScript(this));
		this.factory.Register(CutScene.ActNames[1], new CutAct_ColorFilter(this));
		this.factory.Register(CutScene.ActNames[2], new CutAct_Image(this));
		this.factory.Register(CutScene.ActNames[3], new CutAct_BGM(this));
		this.factory.Register(CutScene.ActNames[4], new CutAct_SE(this));
		this.factory.Register(CutScene.ActNames[5], new CutAct_Voice(this));
		this.factory.Register(CutScene.ActNames[6], new CutAct_SubTitle(this));
		this.factory.Register(CutScene.ActNames[7], new CutAct_Anime(this));
		this.factory.Register(CutScene.ActNames[8], new CutAct_Expression(this));
		this.factory.Register(CutScene.ActNames[9], new CutAct_Camera(this));
		this.factory.Register(CutScene.ActNames[10], new CutAct_Position(this));
		this.factory.Register(CutScene.ActNames[11], new CutAct_CharaShow(this));
		this.factory.Register(CutScene.ActNames[12], new CutAct_IK(this));
		this.factory.Register(CutScene.ActNames[13], new CutAct_Light(this));
		this.factory.Register(CutScene.ActNames[14], new CutAct_NextScene(this));
		this.factory.Register(CutScene.ActNames[15], new CutAct_MemoryEnd(this));
		this.factory.Register(CutScene.ActNames[16], new CutAct_GameVariable(this));
		this.assetBundleCtrl.OpenFromFile(GlobalData.assetBundlePath, this.listAssetBundle);
		this.LoadScript_AssetBundle(this.listAssetName);
		this.dof = this.camera.GetComponent<DepthOfField>();
		this.IsPlay = true;
		this.LastVoiceTime = -1f;
	}

	// Token: 0x06000BBB RID: 3003 RVA: 0x000443BC File Offset: 0x000425BC
	private void Start()
	{
		base.InScene(true);
	}

	// Token: 0x06000BBC RID: 3004 RVA: 0x000443C8 File Offset: 0x000425C8
	public override void OutScene(string next)
	{
		this.assetBundleCtrl.Close(false);
	}

	// Token: 0x06000BBD RID: 3005 RVA: 0x000443D8 File Offset: 0x000425D8
	private void OnDestroy()
	{
		this.assetBundleCtrl.Close(false);
	}

	// Token: 0x06000BBE RID: 3006 RVA: 0x000443E8 File Offset: 0x000425E8
	private void Update()
	{
		this.subtitleRoot.gameObject.SetActive(!this.gameCtrl.IsHideUI);
		if (!this.IsPlay)
		{
			return;
		}
		this.SetHeight();
		bool flag = false;
		while (this.actionNo < this.actions.Count && this.actions[this.actionNo].time <= this.timer)
		{
			CUTACT type = this.actions[this.actionNo].Type;
			this.actions[this.actionNo].Action(false);
			if (this.actions[this.actionNo].Type == CUTACT.VOICE)
			{
				this.LastVoiceTime = this.timer;
			}
			if (type == CUTACT.JUMPSCRIPT)
			{
				flag = true;
				break;
			}
			this.actionNo++;
		}
		if (!flag && this.Click())
		{
			this.SkipNext();
		}
		this.Check_ColorFilter(this.timer);
		if (!flag)
		{
			this.timer += Time.deltaTime;
		}
	}

	// Token: 0x06000BBF RID: 3007 RVA: 0x00044510 File Offset: 0x00042710
	private void LateUpdate()
	{
		float focalLength = 0f;
		if (this.focusType == CutScene.FOCUS.POS)
		{
			focalLength = Vector3.Distance(this.camera.transform.position, this.focusPos);
		}
		else if (this.focusType == CutScene.FOCUS.CHARA)
		{
			focalLength = Vector3.Distance(this.camera.transform.position, this.focusChara.FacePos);
		}
		this.dof.enabled = ConfigData.dofEnable;
		this.dof.focalLength = focalLength;
	}

	// Token: 0x06000BC0 RID: 3008 RVA: 0x0004459C File Offset: 0x0004279C
	public void SetHeight()
	{
	}

	// Token: 0x06000BC1 RID: 3009 RVA: 0x000445A0 File Offset: 0x000427A0
	private bool Click()
	{
		return Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);
	}

	// Token: 0x06000BC2 RID: 3010 RVA: 0x000445F0 File Offset: 0x000427F0
	private void SkipNext()
	{
		if (this.actionNo >= this.actions.Count)
		{
			return;
		}
		bool flag = false;
		this.timer = this.actions[this.actionNo].time;
		while (this.actionNo < this.actions.Count && this.actions[this.actionNo].time <= this.timer)
		{
			if (this.actions[this.actionNo].Type == CUTACT.SUBTITLE)
			{
				this.timer = this.actions[this.actionNo].time;
				flag = true;
			}
			else if (this.actions[this.actionNo].Type == CUTACT.VOICE)
			{
				if (this.LastVoiceTime != this.timer)
				{
					foreach (Human human in this.humans.Values)
					{
						if (!human.IsLoopVoicePlaying())
						{
							human.VoiceShutUp();
						}
					}
				}
				this.LastVoiceTime = this.timer;
			}
			CUTACT type = this.actions[this.actionNo].Type;
			this.actions[this.actionNo].Action(true);
			if (type == CUTACT.JUMPSCRIPT || type == CUTACT.NEXTSCENE)
			{
				return;
			}
			this.actionNo++;
			if (!flag && this.actionNo < this.actions.Count)
			{
				this.timer = this.actions[this.actionNo].time;
			}
		}
	}

	// Token: 0x06000BC3 RID: 3011 RVA: 0x000447C8 File Offset: 0x000429C8
	public void JumpScript(string nextAssetBundle, string nextScript)
	{
		this.assetBundleCtrl.Close(false);
		this.assetBundleCtrl.OpenFromFile(GlobalData.assetBundlePath, nextAssetBundle);
		this.LoadScript_AssetBundle(nextScript);
	}

	// Token: 0x06000BC4 RID: 3012 RVA: 0x000447F0 File Offset: 0x000429F0
	public void LoadScript_AssetBundle(string assetName)
	{
		TextAsset text = this.assetBundleCtrl.LoadAsset<TextAsset>(assetName);
		TagText tt = new TagText(text);
		this.LoadScript(tt);
	}

	// Token: 0x06000BC5 RID: 3013 RVA: 0x00044818 File Offset: 0x00042A18
	public void LoadScript_File(string textPath)
	{
		TagText tt = new TagText(textPath);
		this.LoadScript(tt);
	}

	// Token: 0x06000BC6 RID: 3014 RVA: 0x00044834 File Offset: 0x00042A34
	public void LoadScript(TagText tt)
	{
		this.ClearScript();
		for (int i = 0; i < tt.Elements.Count; i++)
		{
			TagText.Element element = tt.Elements[i];
			if (element.Tag == "Setup")
			{
				this.LoadScript_Setup(element);
			}
			else
			{
				CutAction cutAction = this.factory.Create(element.Tag) as CutAction;
				if (cutAction != null)
				{
					cutAction.Load(element, i);
					this.AddAction(cutAction);
					if (GlobalData.isMemory && cutAction.Type == CUTACT.MEMORYEND)
					{
						break;
					}
				}
			}
		}
		this.SortActions();
		this.actionNo = 0;
		this.LastVoiceTime = -1f;
	}

	// Token: 0x06000BC7 RID: 3015 RVA: 0x000448F4 File Offset: 0x00042AF4
	public T LoadAsset<T>(string assetName) where T : UnityEngine.Object
	{
		return this.assetBundleCtrl.LoadAsset<T>(assetName);
	}

	// Token: 0x06000BC8 RID: 3016 RVA: 0x00044904 File Offset: 0x00042B04
	public void SaveScript(string file)
	{
		TagText tagText = new TagText();
		foreach (CutAction cutAction in this.actions)
		{
			string tag = CutScene.ActNames[(int)cutAction.Type];
			TagText.Element element = new TagText.Element(tag);
			cutAction.Save(element);
			tagText.AddElement(element);
		}
		tagText.Save(file);
	}

	// Token: 0x06000BC9 RID: 3017 RVA: 0x0004498C File Offset: 0x00042B8C
	private void LoadScript_Setup(TagText.Element element)
	{
		string empty = string.Empty;
		if (element.GetVal(ref empty, "map", 0))
		{
			AssetBundleController assetBundleController = new AssetBundleController();
			assetBundleController.OpenFromFile(GlobalData.assetBundlePath, empty);
			int num = empty.LastIndexOf("/");
			string assetName = string.Empty;
			if (num != -1)
			{
				assetName = empty.Substring(num + 1);
			}
			GameObject gameObject = assetBundleController.LoadAndInstantiate<GameObject>(assetName);
			if (gameObject != null)
			{
				this.map = gameObject.GetComponent<Map>();
			}
			else
			{
				this.map = null;
			}
			assetBundleController.Close(false);
			TagText.Attribute attribute = element.GetAttribute("light");
			if (attribute != null)
			{
				float x = 0f;
				float y = 0f;
				attribute.GetVal(ref x, 0);
				attribute.GetVal(ref y, 1);
				this.map.lightRoot.rotation = Quaternion.Euler(x, y, 0f);
			}
		}
		TagText.Attribute attribute2 = element.GetAttribute("male");
		if (attribute2 != null)
		{
			for (int i = 0; i < attribute2.vals.Count / 3; i++)
			{
				int num2 = i * 3;
				string text = attribute2.vals[num2];
				string a = attribute2.vals[num2 + 1];
				string text2 = attribute2.vals[num2 + 2];
				Male male = this.CreateMale(text);
				if (text == "主人公" || text == "猛")
				{
					male.SetMaleID(MALE_ID.HERO);
				}
				else if (text == "広一")
				{
					male.SetMaleID(MALE_ID.KOUICHI);
				}
				if (a == "MaleA")
				{
					male.Load(GlobalData.PlayData.custom_hero, true);
				}
				else if (a == "MaleB")
				{
					male.Load(GlobalData.PlayData.custom_kouichi, true);
				}
				else if (a == "mobA")
				{
					male.Load(GlobalData.PlayData.custom_h_maleMobA, true);
				}
				else if (a == "mobB")
				{
					male.Load(GlobalData.PlayData.custom_h_maleMobB, true);
				}
				else if (a == "mobC")
				{
					male.Load(GlobalData.PlayData.custom_h_maleMobC, true);
				}
				else
				{
					male.Apply();
				}
				male.ChangeMaleShow(MALE_SHOW.CLOTHING);
				if (text2 != "-")
				{
					male.body.Anime.runtimeAnimatorController = this.assetBundleCtrl.LoadAsset<RuntimeAnimatorController>(text2);
				}
				male.SetShowTinWithWear(false);
				male.SoundSpatialBlend(0f);
			}
		}
		TagText.Attribute attribute3 = element.GetAttribute("female");
		if (attribute3 != null)
		{
			for (int j = 0; j < attribute3.vals.Count / 3; j++)
			{
				int num3 = j * 3;
				string name = attribute3.vals[num3];
				string a2 = attribute3.vals[num3 + 1];
				string text3 = attribute3.vals[num3 + 2];
				Female female = this.CreateFemale(name);
				if (a2 != "-")
				{
					if (a2 == "FemaleA")
					{
						female.SetHeroineID(HEROINE.RITSUKO);
						female.Load(GlobalData.PlayData.custom_ritsuko, true);
					}
					else if (a2 == "FemaleB")
					{
						female.SetHeroineID(HEROINE.AKIKO);
						female.Load(GlobalData.PlayData.custom_akiko, true);
					}
					else if (a2 == "FemaleC")
					{
						female.SetHeroineID(HEROINE.YUKIKO);
						female.Load(GlobalData.PlayData.custom_yukiko, true);
					}
					else if (a2 == "FemaleD")
					{
						female.SetHeroineID(HEROINE.MARIKO);
						female.Load(GlobalData.PlayData.custom_mariko, true);
					}
				}
				if (text3 != "-")
				{
					female.body.Anime.runtimeAnimatorController = this.assetBundleCtrl.LoadAsset<RuntimeAnimatorController>(text3);
				}
				female.SoundSpatialBlend(0f);
			}
		}
		foreach (KeyValuePair<string, Human> keyValuePair in this.humans)
		{
			this.humanActSets.Add(keyValuePair.Key, new CharaCutActionSet(keyValuePair.Value));
			if (this.map != null)
			{
				keyValuePair.Value.Foot(this.map.data.foot);
			}
		}
	}

	// Token: 0x06000BCA RID: 3018 RVA: 0x00044E68 File Offset: 0x00043068
	public void Check(float time)
	{
		this.IsPlay = false;
		this.Check_ColorFilter(time);
		this.Check_SubTitle(time);
		this.Check_Camera(time);
		this.Check_Chara(time);
	}

	// Token: 0x06000BCB RID: 3019 RVA: 0x00044E90 File Offset: 0x00043090
	public void NextScene(string scene, string message, float fadeTime = -1f)
	{
		this.assetBundleCtrl.Close(false);
		base.GC.ChangeScene(scene, message, fadeTime);
	}

	// Token: 0x06000BCC RID: 3020 RVA: 0x00044EAC File Offset: 0x000430AC
	private void Check_ColorFilter(float time)
	{
		Color color = new Color(0f, 0f, 0f, 0f);
		if (this.act_ColorFilters.Count != 0)
		{
			CutAct_ColorFilter cutAct_ColorFilter = null;
			CutAct_ColorFilter cutAct_ColorFilter2 = null;
			time = Mathf.Clamp(time, this.act_ColorFilters[0].time, this.act_ColorFilters[this.act_ColorFilters.Count - 1].time);
			for (int i = 0; i < this.act_ColorFilters.Count; i++)
			{
				if (this.act_ColorFilters[i].time <= time)
				{
					cutAct_ColorFilter = this.act_ColorFilters[i];
				}
				if (this.act_ColorFilters[i].time >= time)
				{
					cutAct_ColorFilter2 = this.act_ColorFilters[i];
					break;
				}
			}
			if (cutAct_ColorFilter == cutAct_ColorFilter2)
			{
				color = cutAct_ColorFilter.color;
			}
			else
			{
				float t = Mathf.InverseLerp(cutAct_ColorFilter.time, cutAct_ColorFilter2.time, time);
				color = Color.Lerp(cutAct_ColorFilter.color, cutAct_ColorFilter2.color, t);
			}
		}
		this.colorFilter.color = color;
	}

	// Token: 0x06000BCD RID: 3021 RVA: 0x00044FD0 File Offset: 0x000431D0
	private void Check_SubTitle(float time)
	{
		string text = string.Empty;
		if (this.act_SubTitles.Count != 0)
		{
			CutAct_SubTitle cutAct_SubTitle = null;
			for (int i = 0; i < this.act_SubTitles.Count; i++)
			{
				if (this.act_SubTitles[i].time <= time)
				{
					cutAct_SubTitle = this.act_SubTitles[i];
				}
			}
			if (cutAct_SubTitle != null)
			{
				text = cutAct_SubTitle.text;
			}
		}
		this.SetSubTitle(text);
	}

	// Token: 0x06000BCE RID: 3022 RVA: 0x0004504C File Offset: 0x0004324C
	private void Check_Camera(float time)
	{
		if (this.act_Camera.Count != 0)
		{
			CutAct_Camera cutAct_Camera = null;
			for (int i = 0; i < this.act_Camera.Count; i++)
			{
				if (this.act_Camera[i].time <= time)
				{
					cutAct_Camera = this.act_Camera[i];
				}
			}
			if (cutAct_Camera != null)
			{
				cutAct_Camera.SetCamera();
			}
		}
	}

	// Token: 0x06000BCF RID: 3023 RVA: 0x000450B8 File Offset: 0x000432B8
	private void Check_Chara(float time)
	{
		foreach (CharaCutActionSet charaCutActionSet in this.humanActSets.Values)
		{
			charaCutActionSet.Check(time);
		}
	}

	// Token: 0x06000BD0 RID: 3024 RVA: 0x0004511C File Offset: 0x0004331C
	public Human GetHuman(string name)
	{
		if (!this.humans.ContainsKey(name))
		{
			return null;
		}
		return this.humans[name];
	}

	// Token: 0x06000BD1 RID: 3025 RVA: 0x00045140 File Offset: 0x00043340
	public void SetSubTitle(string text)
	{
		this.subTitle.text = text;
	}

	// Token: 0x06000BD2 RID: 3026 RVA: 0x00045150 File Offset: 0x00043350
	public void SetImage(string file)
	{
		Texture2D texture2D = this.assetBundleCtrl.LoadAsset<Texture2D>(file);
		if (texture2D == null)
		{
			GlobalData.Debug_LogError("看不懂纹理:" + file);
			return;
		}
		Vector2 vector = new Vector2((float)texture2D.width, (float)texture2D.height);
		Rect rect = new Rect(Vector2.zero, vector);
		Vector2 pivot = vector * 0.5f;
		this.image.sprite = Sprite.Create(texture2D, rect, pivot, 100f, 0U, SpriteMeshType.FullRect);
	}

	// Token: 0x06000BD3 RID: 3027 RVA: 0x000451D0 File Offset: 0x000433D0
	public void ShowImage(bool show)
	{
		this.image.enabled = show;
	}

	// Token: 0x06000BD4 RID: 3028 RVA: 0x000451E0 File Offset: 0x000433E0
	public void SetCamera(Vector3 pos, Quaternion rot, float fov)
	{
		this.camera.transform.position = pos;
		this.camera.transform.rotation = rot;
		if (fov > 0f)
		{
			this.camera.fieldOfView = fov;
		}
	}

	// Token: 0x06000BD5 RID: 3029 RVA: 0x0004521C File Offset: 0x0004341C
	public void SetFocus(Vector3 pos)
	{
		this.focusType = CutScene.FOCUS.POS;
		this.focusPos = pos;
		this.focusChara = null;
	}

	// Token: 0x06000BD6 RID: 3030 RVA: 0x00045234 File Offset: 0x00043434
	public void SetFocus(string chara)
	{
		this.focusType = CutScene.FOCUS.CHARA;
		this.focusChara = this.GetHuman(chara);
	}

	// Token: 0x06000BD7 RID: 3031 RVA: 0x0004524C File Offset: 0x0004344C
	public void AddAction(CUTACT actType, float time)
	{
		this.IsPlay = false;
		CutAction cutAction = this.factory.Create(CutScene.ActNames[(int)actType]) as CutAction;
		cutAction.time = time;
		if (cutAction != null)
		{
			this.AddAction(cutAction);
			this.SortActions();
		}
	}

	// Token: 0x06000BD8 RID: 3032 RVA: 0x00045294 File Offset: 0x00043494
	private void AddAction(CutAction act)
	{
		this.actions.Add(act);
		if (act.Type == CUTACT.COLORFILTER)
		{
			this.act_ColorFilters.Add(act as CutAct_ColorFilter);
		}
		else if (act.Type == CUTACT.SUBTITLE)
		{
			this.act_SubTitles.Add(act as CutAct_SubTitle);
		}
		else if (act.Type == CUTACT.CAMERA)
		{
			this.act_Camera.Add(act as CutAct_Camera);
		}
		else if (act.Type == CUTACT.ANIME)
		{
			CutAct_Anime cutAct_Anime = act as CutAct_Anime;
			if (this.humanActSets.ContainsKey(cutAct_Anime.chara))
			{
				this.humanActSets[cutAct_Anime.chara].AddAct(cutAct_Anime);
			}
			else
			{
				GlobalData.Debug_LogError("不明角色：" + cutAct_Anime.chara);
			}
		}
		else if (act.Type == CUTACT.VOICE)
		{
			CutAct_Voice cutAct_Voice = act as CutAct_Voice;
			if (this.humanActSets.ContainsKey(cutAct_Voice.chara))
			{
				this.humanActSets[cutAct_Voice.chara].AddAct(cutAct_Voice);
			}
			else
			{
				GlobalData.Debug_LogError("不明角色：" + cutAct_Voice.chara);
			}
		}
	}

	// Token: 0x06000BD9 RID: 3033 RVA: 0x000453D0 File Offset: 0x000435D0
	public void DeleteAction(CutAction act)
	{
		this.IsPlay = false;
		this.actions.Remove(act);
		if (act.Type == CUTACT.COLORFILTER)
		{
			this.act_ColorFilters.Remove(act as CutAct_ColorFilter);
		}
		else if (act.Type == CUTACT.SUBTITLE)
		{
			this.act_SubTitles.Remove(act as CutAct_SubTitle);
		}
		else if (act.Type == CUTACT.CAMERA)
		{
			this.act_Camera.Remove(act as CutAct_Camera);
		}
		else if (act.Type == CUTACT.ANIME)
		{
			CutAct_Anime cutAct_Anime = act as CutAct_Anime;
			this.humanActSets[cutAct_Anime.chara].RemoveAct(cutAct_Anime);
		}
		else if (act.Type == CUTACT.VOICE)
		{
			CutAct_Voice cutAct_Voice = act as CutAct_Voice;
			this.humanActSets[cutAct_Voice.chara].RemoveAct(cutAct_Voice);
		}
	}

	// Token: 0x06000BDA RID: 3034 RVA: 0x000454B4 File Offset: 0x000436B4
	private void ClearScript()
	{
		this.actions.Clear();
		this.act_ColorFilters.Clear();
		this.act_SubTitles.Clear();
		this.act_Camera.Clear();
		this.humanActSets.Clear();
		foreach (KeyValuePair<string, Human> keyValuePair in this.humans)
		{
			UnityEngine.Object.Destroy(keyValuePair.Value.gameObject);
		}
		this.humans.Clear();
		this.females.Clear();
		this.males.Clear();
		this.focusChara = null;
		this.focusType = CutScene.FOCUS.NONE;
		if (this.map != null)
		{
			UnityEngine.Object.Destroy(this.map.gameObject);
		}
		this.actionNo = 0;
		this.timer = 0f;
		this.LastVoiceTime = -1f;
	}

	// Token: 0x06000BDB RID: 3035 RVA: 0x000455C0 File Offset: 0x000437C0
	public void SortActions()
	{
		List<CutAction> list = this.actions;
		if (CutScene.callback0 == null)
		{
			CutScene.callback0 = new Comparison<CutAction>(CutScene.SortFunc);
		}
		list.Sort(CutScene.callback0);
		List<CutAct_ColorFilter> list2 = this.act_ColorFilters;
		if (CutScene.callback1 == null)
		{
			CutScene.callback1 = new Comparison<CutAct_ColorFilter>(CutScene.SortFunc);
		}
		list2.Sort(CutScene.callback1);
		List<CutAct_SubTitle> list3 = this.act_SubTitles;
		if (CutScene.callback2 == null)
		{
			CutScene.callback2 = new Comparison<CutAct_SubTitle>(CutScene.SortFunc);
		}
		list3.Sort(CutScene.callback2);
		List<CutAct_Camera> list4 = this.act_Camera;
		if (CutScene.callback3 == null)
		{
			CutScene.callback3 = new Comparison<CutAct_Camera>(CutScene.SortFunc);
		}
		list4.Sort(CutScene.callback3);
		foreach (CharaCutActionSet charaCutActionSet in this.humanActSets.Values)
		{
			charaCutActionSet.Sort();
		}
	}

	// Token: 0x06000BDC RID: 3036 RVA: 0x000456C0 File Offset: 0x000438C0
	public static int SortFunc(CutAction a, CutAction b)
	{
		if (a == null || b == null)
		{
			GlobalData.Debug_LogError("操作为空");
		}
		float num = a.time - b.time;
		int num2 = (int)num;
		if (num < 0f)
		{
			num2--;
		}
		if (num > 0f)
		{
			num2++;
		}
		if (num == 0f)
		{
			num2 = a.order - b.order;
		}
		return num2;
	}

	// Token: 0x06000BDD RID: 3037 RVA: 0x0004572C File Offset: 0x0004392C
	public Female CreateFemale(string name)
	{
		Female female = UnityEngine.Object.Instantiate<Female>(this.femaleOriginal);
		female.ChangeShowGag(false);
		this.humans.Add(name, female);
		this.females.Add(female);
		return female;
	}

	// Token: 0x06000BDE RID: 3038 RVA: 0x00045768 File Offset: 0x00043968
	public Male CreateMale(string name)
	{
		Male male = UnityEngine.Object.Instantiate<Male>(this.maleOriginal);
		this.humans.Add(name, male);
		this.males.Add(male);
		return male;
	}

	// Token: 0x06000BDF RID: 3039 RVA: 0x0004579C File Offset: 0x0004399C
	public void SetLight(float yaw, float pitch)
	{
		if (this.map != null)
		{
			this.map.lightRoot.rotation = Quaternion.Euler(pitch, yaw, 0f);
		}
	}

	// Token: 0x04000BEC RID: 3052
	[SerializeField]
	public Female femaleOriginal;

	// Token: 0x04000BED RID: 3053
	[SerializeField]
	public Male maleOriginal;

	// Token: 0x04000BEE RID: 3054
	public string listAssetBundle;

	// Token: 0x04000BEF RID: 3055
	public string listAssetName;

	// Token: 0x04000BF0 RID: 3056
	public Camera camera;

	// Token: 0x04000BF1 RID: 3057
	private DepthOfField dof;

	// Token: 0x04000BF2 RID: 3058
	private CutScene.FOCUS focusType;

	// Token: 0x04000BF3 RID: 3059
	private Vector3 focusPos;

	// Token: 0x04000BF4 RID: 3060
	private Human focusChara;

	// Token: 0x04000BF5 RID: 3061
	[SerializeField]
	private GameObject subtitleRoot;

	// Token: 0x04000BF6 RID: 3062
	[SerializeField]
	private Text subTitle;

	// Token: 0x04000BF7 RID: 3063
	[SerializeField]
	private Image colorFilter;

	// Token: 0x04000BF8 RID: 3064
	[SerializeField]
	private Image image;

	// Token: 0x04000BF9 RID: 3065
	private Dictionary<string, Human> humans = new Dictionary<string, Human>();

	// Token: 0x04000BFA RID: 3066
	private Dictionary<string, CharaCutActionSet> humanActSets = new Dictionary<string, CharaCutActionSet>();

	// Token: 0x04000BFB RID: 3067
	private List<Female> females = new List<Female>();

	// Token: 0x04000BFC RID: 3068
	private List<Male> males = new List<Male>();

	// Token: 0x04000BFD RID: 3069
	private Map map;

	// Token: 0x04000BFE RID: 3070
	private CustomDataListLoader list = new CustomDataListLoader();

	// Token: 0x04000BFF RID: 3071
	private int timeID;

	// Token: 0x04000C00 RID: 3072
	private int charaID = 1;

	// Token: 0x04000C01 RID: 3073
	private int textID = 2;

	// Token: 0x04000C02 RID: 3074
	private int voiceID = 3;

	// Token: 0x04000C03 RID: 3075
	private AssetBundleController assetBundleCtrl = new AssetBundleController();

	// Token: 0x04000C04 RID: 3076
	private CutActFactory factory;

	// Token: 0x04000C05 RID: 3077
	private List<CutAction> actions = new List<CutAction>();

	// Token: 0x04000C06 RID: 3078
	private List<CutAct_ColorFilter> act_ColorFilters = new List<CutAct_ColorFilter>();

	// Token: 0x04000C07 RID: 3079
	private List<CutAct_SubTitle> act_SubTitles = new List<CutAct_SubTitle>();

	// Token: 0x04000C08 RID: 3080
	private List<CutAct_Camera> act_Camera = new List<CutAct_Camera>();

	// Token: 0x04000C09 RID: 3081
	private int actionNo;

	// Token: 0x04000C0A RID: 3082
	private float timer;

	// Token: 0x04000C0E RID: 3086
	private static readonly string[] ActNames = new string[]
	{
		"JumpScript",
		"ColorFilter",
		"Image",
		"BGM",
		"SE",
		"Voice",
		"SubTitle",
		"Anime",
		"Expression",
		"Camera",
		"Position",
		"CharaShow",
		"IK",
		"Light",
		"NextScene",
		"MemoryEnd",
		"GameVariable"
	};

	// Token: 0x04000C0F RID: 3087
	[CompilerGenerated]
	private static Comparison<CutAction> callback0;

	// Token: 0x04000C10 RID: 3088
	[CompilerGenerated]
	private static Comparison<CutAct_ColorFilter> callback1;

	// Token: 0x04000C11 RID: 3089
	[CompilerGenerated]
	private static Comparison<CutAct_SubTitle> callback2;

	// Token: 0x04000C12 RID: 3090
	[CompilerGenerated]
	private static Comparison<CutAct_Camera> callback3;

	// Token: 0x020001C7 RID: 455
	public enum FOCUS
	{
		// Token: 0x04000C14 RID: 3092
		NONE,
		// Token: 0x04000C15 RID: 3093
		POS,
		// Token: 0x04000C16 RID: 3094
		CHARA
	}
}
